﻿SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON

GO


CREATE PROCEDURE [dbo].[bhp_temp_ModBlogStructure]
AS
BEGIN

	DECLARE
		@SettingsGroupId		INT
		
	SELECT @SettingsGroupId = id FROM n_Tree WHERE name = 'BLOG_SETTINGS' AND parent = 0
	
	
	EXEC [dbo].[n_ColFAdd] @rel = @SettingsGroupId, @name = N'use_tag_system', @typ = 5, @siz1 = 3, @siz2 = 1, @user = 900900
	INSERT INTO bht_Columns (ColumnId, DisplayName, [Description], Sort)
    SELECT
        id, N'Używać systemu tagów?', N'', 3
    FROM
        n_Tree t
    WHERE
        parent = @SettingsGroupId
        AND name = N'use_tag_system'
	ALTER TABLE dbo.BLOG_SETTINGS ADD CONSTRAINT
		DF_BLOG_SETTINGS_use_tag_system DEFAULT 1 FOR use_tag_system
	
		
	EXEC [dbo].[n_ColFAdd] @rel = @SettingsGroupId, @name = N'allow_user_change_url', @typ = 5, @siz1 = 3, @siz2 = 1, @user = 900900
	INSERT INTO bht_Columns (ColumnId, DisplayName, [Description], Sort)
    SELECT
        id, N'Zezwolić użytkownikom na zmianę adresu URL?', N'', 4
    FROM
        n_Tree t
    WHERE
        parent = @SettingsGroupId
        AND name = N'allow_user_change_url'
	ALTER TABLE dbo.BLOG_SETTINGS ADD CONSTRAINT
		DF_BLOG_SETTINGS_allow_user_change_url DEFAULT 0 FOR allow_user_change_url
	
		
	EXEC [dbo].[n_ColFAdd] @rel = @SettingsGroupId, @name = N'enable_short_description', @typ = 5, @siz1 = 3, @siz2 = 1, @user = 900900
	INSERT INTO bht_Columns (ColumnId, DisplayName, [Description], Sort)
    SELECT
        id, N'Używać krótkiego opisu?', N'', 5
    FROM
        n_Tree t
    WHERE
        parent = @SettingsGroupId
        AND name = N'enable_short_description'
	ALTER TABLE dbo.BLOG_SETTINGS ADD CONSTRAINT
		DF_BLOG_SETTINGS_enable_short_description DEFAULT 0 FOR enable_short_description
	
		
END
GO

EXEC [bhp_temp_ModBlogStructure]
GO

DROP PROCEDURE [bhp_temp_ModBlogStructure]